<?php

namespace app\controller;

use app\service\OriginalPlanNodeService;
use support\Request;
use support\Response;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;


class OriginalPlanNodeController
{
    //原计划节点统计服务
    protected $originalPlanNodeService;

    public function __construct()
    {
        $this->originalPlanNodeService = OriginalPlanNodeService::getInstance();
    }


    /**
     * 获取历史存在异常的集数列表，附带异常实体数据统计
     * @param Request $request
     * @return Response
     */
    public function getHistoryAbnormalEpisodeList(Request $request): Response
    {
        $param = $request->post()['param'];
        $response = $this->originalPlanNodeService->getHistoryAbnormalEpisodeList($param['entity_module_code'], $param['project_id'], $param['time_range']);
        return json(success_response('success', $response));
    }

}
